package com.guava;

import com.enniu.alipay.api.domain.User;
import com.google.common.base.Optional;

public class DemoGuava {

	public static void testNull()
	{
		Optional<Integer> possible = Optional.of(5);
		System.out.println(possible.isPresent());
	
		Optional<User> users = Optional.absent();
		users.of(new User());
//		User user = new User();
//		user.setUsername("张三");
//		users.or(user);
//		users.get().getUsername();
		
		System.out.println(users.isPresent());
	
//		Optional<User> nulluser = Optional.of(null);
//		System.out.println(nulluser.isPresent());
	}
	
	public static void main(String[] args) {
		testNull();
	}
	
	
}
